package vim.meet.aspect;

//import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AfterThrowingAdviceExample {
	
	
	@Pointcut("execution(* cn.freemethod.aspect.target.BeforeTarget.afterThrow())")
	private void afterThrow(){}
	
	@AfterThrowing(pointcut="afterThrow()",throwing="ex")
	public void doThrow(RuntimeException ex) {
		System.out.println(ex.getMessage());
		System.out.println(ex.getClass().getName());
		System.out.println("in:"+AfterThrowingAdviceExample.class.getName()+":doThrow method!");
	}
	
//	@After("afterThrow()")
//	public void afterFinally()
//	{
//		
//	}

}
